package com.study.email.controller;

import org.jasypt.encryption.StringEncryptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.study.email.service.MailService;

@RestController
public class TestController {
	
	@Autowired
    private StringEncryptor stringEncryptor;

	@Autowired
    private MailService mailService;
	
	@GetMapping("/test")
	public String test() {
		mailService.sendSimpleMail("694647846@qq.com", "这是一封简单邮件", "这是一封普通的SpringBoot测试邮件");
		return "success";
	}
	
	@GetMapping("getEncry")
	public String getEncry() {
		return stringEncryptor.encrypt("mr888888");
	}
}
